package com.wgts.wgts.localbean;

import android.os.Parcel;
import android.os.Parcelable;

public class ProductInfoAttribute  implements Parcelable {
    public int id;
    public String key;
    public int productId;

    public int amount;

    public String retailPrice;

    public String image;

    public String attribute;

    public int activitySkuId;



    public ProductInfoAttribute(){}

    protected ProductInfoAttribute(Parcel in) {
        id = in.readInt();
        key = in.readString();
        productId = in.readInt();
        amount = in.readInt();
        retailPrice = in.readString();
        image = in.readString();
        attribute = in.readString();
        activitySkuId = in.readInt();
    }

    public static final Creator<ProductInfoAttribute> CREATOR = new Creator<ProductInfoAttribute>() {
        @Override
        public ProductInfoAttribute createFromParcel(Parcel in) {
            return new ProductInfoAttribute(in);
        }

        @Override
        public ProductInfoAttribute[] newArray(int size) {
            return new ProductInfoAttribute[size];
        }
    };

    @Override
    public boolean equals(Object obj){
        return key.equals((String)obj);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(key);
        dest.writeInt(productId);
        dest.writeInt(amount);
        dest.writeString(retailPrice);
        dest.writeString(image);
        dest.writeString(attribute);
        dest.writeInt(activitySkuId);
    }
}
